<%@page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="java.util.*"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="dreamtime.dreamnews.news.*"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.sql.*"%>
<%@page import="dreamtime.dreamnews.*"%>
<%@page import="java.sql.SQLException"%>
<%@page import="dreamtime.dreamnews.page.Page,dreamtime.dreamnews.page.PageView"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>河南物料物流有限公司</title>
<meta name="Keywords" content="河南物料物流有限公司"/>
<meta name="Description" content="河南物料物流有限公司" />
<link href="css/css.css" type="text/css" rel="stylesheet" />
<!-- IE6下PNG图片背景透明 -->
<SCRIPT src="js/touming.js" type=text/javascript></SCRIPT>
<!-- banner幻灯效果 -->
<script src="js/yu.js" type="text/javascript"></script>
<script src="js/tb.js" type="text/javascript"></script>
<!-- 屏蔽JS错误的代码 -->
<script>
function ResumeError() { 
return true; 
} 
window.onerror = ResumeError;
</script>

<body>
<jsp:include page="header.jsp" flush="true"/>
<!-- box begin -->
<div class="BOX_top all_width">
   <div id="box">  
<!-- banner begin -->
<div id="MainPromotionBanner">
   <div id="SlidePlayer">
      <ul class="Slides">
         <li><a target="_blank" href="#"><img src="images/banner1.jpg"></a></li>
         <li><a target="_blank" href="#"><img src="images/banner2.jpg"></a></li>
         <li><a target="_blank" href="#"><img src="images/banner3.jpg"></a></li>
      </ul>
   </div>
   <script type="text/javascript">
	   TB.widget.SimpleSlide.decoration('SlidePlayer', {eventType:'mouse', effect:'scroll'});
   </script>
</div>
<!-- banner end -->
<table width="1000" border="0" cellpadding="0" cellspacing="0" class="left">
  <tr>
    <td align="left" valign="top" id="about_box_left">
      <jsp:include page="left.jsp" flush="true"/>
    </td>
    <td align="left" valign="top" id="about_box_right">
       <dl id="box_right_tit">
          <dt>产品展示</dt>
          <dd>PRODUCT SHOW</dd>
       </dl>
       <div id="about_name"><a href="index.html" title="" onFocus="this.blur()">首页</a>  ->  产品展示</div>
       <div id="NEWS_right_box">
 <%     DBConnection accessconn=new DBConnection();
        Connection conn=null;
        PreparedStatement pstmt=null;
        PreparedStatement pstmt1=null;
		ResultSet rs=null;	
		try{ 
        conn=accessconn.getConn();
        pstmt=conn.prepareStatement("select newsid,newstitle,newstime,newspicture from news where smallclassid=? and IsImg='yes' order by newsid desc",ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
        pstmt1=conn.prepareStatement("select count(*) as count from news where smallclassid=? and IsImg='yes'");
        //得到类别
        int smallclassid=44;
         String idString=request.getParameter("smallclassid");
        if(idString!=null&&idString.matches("[0-9]*[1-9][0-9]*")){
        smallclassid=Integer.parseInt(idString);
        }
        //每页显示记录数
        int pageSize=10;
        //开始读取页数
        int startPage=1;
        String startPageString=request.getParameter("pageNumber");
        if(startPageString!=null&&startPageString.matches("[0-9]*[1-9][0-9]*"))
        {
        startPage=Integer.parseInt(startPageString);
        }
        int count=LinkNews.getCountRows(conn,pstmt1,rs,smallclassid);
        Page strpage = new Page(startPage,pageSize,count);
        //开始记录号
        int startRow=strpage.getViewStart();
        //当前页的记录数
        int size=strpage.getSize();
    	//工作信息
        HashMap     reportNewsMap=LinkNews.getNewsMap(conn,pstmt,rs,smallclassid,startRow,12,10);
		ArrayList   reportIdList=(ArrayList)reportNewsMap.get("newsid");
		ArrayList   reportTitleList=(ArrayList)reportNewsMap.get("newstitle");
		ArrayList   reportTimeList=(ArrayList)reportNewsMap.get("newstime");
		ArrayList   reportPictureList=(ArrayList)reportNewsMap.get("newspicture");   
        //初始化page    
        for(int i=0;i<reportIdList.size();i++){ 
%>
<div class="box_one">
<a href="<%=response.encodeURL("/automobile/newsContent.jsp?newsid="+(String)reportIdList.get(i))%>"  title="<%=(String)reportTitleList.get(i)%>" target="_blank" onFocus="this.blur()">
<img src="<%="../"+(String)reportPictureList.get(i)%>" width="160" height="112" alt="" />
</a>
<p>
<a href="<%=response.encodeURL("/automobile/newsContent.jsp?newsid="+(String)reportIdList.get(i))%>" title="<%=(String)reportTitleList.get(i)%>" target="_blank" onFocus="this.blur()">
<%=(String)reportTitleList.get(i)%>
</a>
</p>
</div>
<%}%>
<div class="feilei">
<%
    PageView view = new PageView(request,out,"product.jsp?smallclassid="+smallclassid,strpage);
    view.setVisible(true,true,0,2);
%>
</div>
<%
  }catch(SQLException se){
  out.print(se.getMessage());
  }finally{
  pstmt=pstmt1;
  accessconn.closeResultSet(rs);
  accessconn.closePreparedStatement(pstmt);
  accessconn.closeConnection(conn);
  }
%>
</div>    
</td>
  </tr>
</table>
  </div>
</div>
<!-- box end -->
<jsp:include page="footer.jsp" flush="true"/>
</body>
</html>